import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersisted from 'pinia-plugin-persistedstate'

import App from './App.vue'
import router from './router'
import { lazyDirective } from '@/directives'
import { componentPlugin } from '@/components'

// 引入初始化样式文件
import '@/styles/common.scss'

const app = createApp(App)
const pinia = createPinia()
pinia.use(piniaPluginPersisted)

app.use(pinia)
app.use(router)
app.use(lazyDirective)  // 懒加载指令
app.use(componentPlugin)  // 注册全局组件

app.mount('#app')
